package com.atguigu01.create.exer2;

/**
 * ClassName: Exer
 * Package: com.atguigu01.create.exer2
 * Description:
 *
 * @Author ZY
 * @Create 14:51
 * @Version 1.0
 */
public class Exer {
    public static void main(String[] args) {

        A a = new A();
        a.start();

        B b = new B(a);
        b.start();

    }

}


//创建线程类A
class A extends Thread {
    @Override
    public void run() {
        System.out.println("线程A的run()...");
    }
}


//创建线程类B
class B extends Thread {
    private A a;

    public B(A a) {
        this.a = a;
    }

    @Override
    public void run() {
        System.out.println("线程B的run()...");
    }
}

